package com.tim.temp;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;

/**
 * 安装订单详情响应对象
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class QueryOrderDetailResponse {

    @JsonProperty("Success")
    @ApiModelProperty(value = "操作是否成功", allowableValues = "true, false", notes = "true：成功，false：失败")
    private Boolean success;

    @JsonProperty("Messages")
    @ApiModelProperty(value = "错误信息列表")
    private List<String> messages;

    @JsonProperty("AllMessages")
    @ApiModelProperty(value = "所有错误信息的合并字符串")
    private String allMessages;

    @JsonProperty("HasErrors")
    @ApiModelProperty(value = "是否存在错误", allowableValues = "true, false", notes = "true：存在错误，false：不存在错误")
    private Boolean hasErrors;

    @JsonProperty("Data")
    @ApiModelProperty(value = "返回的订单数据对象")
    private QueryOrderData data;
}

/**
 * 订单详细信息对象
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
class QueryOrderData {

    @JsonProperty("Deleted")
    @ApiModelProperty(value = "是否已删除")
    private Boolean deleted;

    @JsonProperty("AppCode")
    @ApiModelProperty(value = "申请编号")
    private String appCode;

    @JsonProperty("UserAddress")
    @ApiModelProperty(value = "车主地址")
    private String userAddress;

    @JsonProperty("Remark")
    @ApiModelProperty(value = "备注")
    private String remark;

    @JsonProperty("AreaName")
    @ApiModelProperty(value = "安装城市")
    private String areaName;

    @JsonProperty("UserPhone")
    @ApiModelProperty(value = "用户电话")
    private String userPhone;

    @JsonProperty("LinkMan")
    @ApiModelProperty(value = "联系人")
    private String linkMan;

    @JsonProperty("imgNum")
    @ApiModelProperty(value = "设备图片总个数")
    private String imgNum;

    @JsonProperty("SeriesName")
    @ApiModelProperty(value = "车系")
    private String seriesName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", shape = JsonFormat.Shape.STRING)
    @JsonProperty("CreatedAt")
    @ApiModelProperty(value = "下单时间", notes = "格式：yyyy-MM-dd HH:mm")
    private LocalDateTime createdAt;

    @JsonProperty("SpecialTag")
    @ApiModelProperty(value = "担保标记")
    private String specialTag;

    @JsonProperty("IDCode")
    @ApiModelProperty(value = "证件编号")
    private String idCode;

    @JsonProperty("InsurancePeriod")
    @ApiModelProperty(value = "保险年限", allowableValues = "1,2,3")
    private Integer insurancePeriod;

    @JsonProperty("InsuranceType")
    @ApiModelProperty(value = "保险类型")
    private String insuranceType;

    @JsonProperty("ActualCarType")
    @ApiModelProperty(value = "实际车型")
    private String actualCarType;

    @JsonProperty("CompensationDQ")
    @ApiModelProperty(value = "盗抢险受偿单位")
    private String compensationDQ;

    @JsonProperty("ProductType")
    @ApiModelProperty(value = "产品类型")
    private String productType;

    @JsonProperty("ActualInstallName")
    @ApiModelProperty(value = "实际加装人")
    private String actualInstallName;

    @JsonProperty("SeriesId")
    @ApiModelProperty(value = "车系Id")
    private UUID seriesId;

    @JsonProperty("VIN")
    @ApiModelProperty(value = "车架号")
    private String vin;

    @JsonProperty("CarPrice")
    @ApiModelProperty(value = "车辆价格")
    private BigDecimal carPrice;

    @JsonProperty("DistrictName")
    @ApiModelProperty(value = "地区名称")
    private String districtName;

    @JsonProperty("Num")
    @ApiModelProperty(value = "加装设备数量")
    private Integer num;

    @JsonProperty("BrandId")
    @ApiModelProperty(value = "车牌Id")
    private UUID brandId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", shape = JsonFormat.Shape.STRING)
    @JsonProperty("ActualInstallTime")
    @ApiModelProperty(value = "实际加装时间", notes = "格式：yyyy-MM-dd HH:mm")
    private LocalDateTime actualInstallTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", shape = JsonFormat.Shape.STRING)
    @JsonProperty("InsertTime")
    @ApiModelProperty(value = "设备录入日期", notes = "格式：yyyy-MM-dd HH:mm")
    private LocalDateTime insertTime;

    @JsonProperty("ActualShopName")
    @ApiModelProperty(value = "实际加装门店")
    private String actualShopName;

    @JsonProperty("InsuranceFlag")
    @ApiModelProperty(value = "是否有保单", allowableValues = "0,1,Y,N", notes = "Y/N 或 1/0")
    private String insuranceFlag;

    @JsonProperty("ActualInstallId")
    @ApiModelProperty(value = "实际加装人Id")
    private UUID actualInstallId;

    @JsonProperty("BrandName")
    @ApiModelProperty(value = "车辆品牌")
    private String brandName;

    @JsonProperty("OrderStatus")
    @ApiModelProperty(value = "工单当前状态", allowableValues = "等待派单,等待加装,加装完成")
    private String orderStatus;

    @JsonProperty("UserName")
    @ApiModelProperty(value = "用户名称")
    private String userName;

    @JsonProperty("CreditPeriod")
    @ApiModelProperty(value = "贷款期限", notes = "单位：月")
    private String creditPeriod;

    @JsonProperty("LoanAmount")
    @ApiModelProperty(value = "贷款金额")
    private BigDecimal loanAmount;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", shape = JsonFormat.Shape.STRING)
    @JsonProperty("InstallTime")
    @ApiModelProperty(value = "要求加装时间", notes = "格式：yyyy-MM-dd HH:mm")
    private LocalDateTime installTime;

    @JsonProperty("UserCity")
    @ApiModelProperty(value = "车主城市")
    private String userCity;

    @JsonProperty("AppointmentStr")
    @ApiModelProperty(value = "预约备注")
    private String appointmentStr;

    @JsonProperty("Appointments")
    @ApiModelProperty(value = "预约备注列表")
    private List<AppointmentRemark> appointments;


    @JsonProperty("CarType")
    @ApiModelProperty(value = "车型")
    private String carType;

    @JsonProperty("ShopName")
    @ApiModelProperty(value = "店面名称")
    private String shopName;

    @JsonProperty("Prescription")
    @ApiModelProperty(value = "加装时效", allowableValues = "0,1,2", notes = "0:当天, 1:第二天, 2:其它")
    private Integer prescription;

    @JsonProperty("InvoicePrice")
    @ApiModelProperty(value = "开票价格")
    private BigDecimal invoicePrice;

    @JsonProperty("LinkPhone")
    @ApiModelProperty(value = "联系电话")
    private String linkPhone;

    @JsonProperty("DistrictCode")
    @ApiModelProperty(value = "地区编号")
    private String districtCode;

    @JsonProperty("EngineNumber")
    @ApiModelProperty(value = "发动机号")
    private String engineNumber;

    @JsonProperty("PlateNumber")
    @ApiModelProperty(value = "车牌号")
    private String plateNumber;

    @JsonProperty("InstallType")
    @ApiModelProperty(value = "加装类型", allowableValues = "0,1", notes = "0：中瑞安装，1：客户自装")
    private Integer installType;

    @JsonProperty("ActualInstallDisplayName")
    @ApiModelProperty(value = "实际加装人姓名")
    private String actualInstallDisplayName;

    @JsonProperty("InstallAdd")
    @ApiModelProperty(value = "安装地址")
    private String installAdd;

    @JsonProperty("FromType")
    @ApiModelProperty(value = "工单类型", allowableValues = "0,1,2,...", notes = "0: VPS工单，非0: 智车品工单")
    private Integer fromType;

    @JsonProperty("InstallAdressStr")
    @ApiModelProperty(value = "安装完成实际地址")
    private String installAdressStr;
}

class AppointmentRemark {

    @JsonProperty("Operator")
    @ApiModelProperty(value = "提交人")
    private String operator;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", shape = JsonFormat.Shape.STRING)
    @JsonProperty("OrderTime")
    @ApiModelProperty(value = "提交时间", notes = "格式：yyyy-MM-dd HH:mm")
    private LocalDateTime orderTime;

    @JsonProperty("IfAppointed")
    @ApiModelProperty(value = "反馈类型")
    private String ifAppointed;
}
